package com.cn.aam.checaiduo.ui.me;


import android.content.Context;
import android.content.Intent;
import android.widget.TextView;

import com.cn.aam.checaiduo.R;
import com.cn.aam.checaiduo.base.BaseActivity;
import com.cn.aam.checaiduo.base.ToolBarManager;
import com.cn.aam.checaiduo.utils.MyViewsUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 充值&提现
 */
public class RechargeWithDrawHomeActivity extends BaseActivity {

    @BindView(R.id.tv_balance)
    TextView tvBalance;

    private String balance;


    public static Intent newInstance(Context context, String balance) {
        Intent intent = new Intent(context, RechargeWithDrawHomeActivity.class);
        intent.putExtra("balance", balance);
        return intent;
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_recharge_with_draw_home;
    }

    @Override
    protected void initView() {
        ToolBarManager.with(this, WMContent)
                .setTitle("充值/提现")
                .setNavigationIcon(R.drawable.ic_nav_arrow_white)
                .setMenuTextContent("记录")
                .setMenuTextClick(new ToolBarManager.OnMenuTextClickListener() {
                    @Override
                    public void onMenuTextClick() {
                        if (MyViewsUtils.isFastDoubleClick()) return;
                        startActivity(RechargeWithDrawRecordActivity.newInstance(mContext));
                    }
                });

        balance = getIntent().getStringExtra("balance");
        tvBalance.setText(balance);
    }

    /**
     * 充值
     */
    @OnClick(R.id.btn_recharge)
    public void onClickRecharge() {
        if (MyViewsUtils.isFastDoubleClick()) return;
        startActivity(RechargeActivity.newInstance(mContext));
    }

    /**
     * 提现
     */
    @OnClick(R.id.btn_withdraw)
    public void onClickWithdraw() {
        if (MyViewsUtils.isFastDoubleClick()) return;
        startActivity(WithDrawActivity.newInstance(mContext, balance));
    }


}
